{%  extends "bootstrap/base.html" %}
{% block title %} Flasky {% endblock %}



{% block head %}
{{ super() }}

<!-- 加载 静态文件 favicon.ico    -->
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
<link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon" >

{% endblock %}



{% block navbar %}
<div class="navbar navbar-inverse" role="navigation">
              <div class="container">
                            <div class="navbar-header">
                                          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                                                        <span class="sr-only"> Toggle navigation </span>
                                                        <span class="icon-bar"></span>
                                                        <span class="icon-bar"></span>			
                                                        <span class="icon-bar"></span>				
                                          </button>
                                          <!-- main.index #蓝本名.index -->
                                          <a  class="navbar-brand" href="{{ url_for('main.index') }}">Flasky</a>
                            </div>
                            <div class="navbar-collapse collapse">
                                          <ul class="nav navbar-nav">
                                                        <li><a href="{{ url_for('main.index') }}">Home</a></li>
                                          </ul>

                                        <ul class="nav navbar-nav navbar-right"> <!-- 右边 -->
                                        {#  根据当前用户的登录状态分别显示“登录”或“退出”链接 #}
                                         {% if current_user.is_authenticated() %}
                                            <li><a href="{{ url_for('auth.user', username=current_user.username) }}">用户: {{ current_user.username }} </a></li>
                                            <li><a href="{{ url_for('auth.logout') }}">退出</a></li>
                                          {% else %}
                                            <li><a href="{{ url_for('auth.login')}}">登录</a></li>
                                         {% endif %}
                                        </ul>

                            </div>



              </div>
</div>
{% endblock %}


{% block content %}
<div class="container">

              {% for message in get_flashed_messages() %}
              <div class="alert alert-warning">
                   <button type="button" class="close" data-dismiss="alert">&times;</button>
                   {{ message }}
              </div>
              {% endfor %}

              {% block page_content %} {%  endblock %}
</div>
{% endblock %}


{% block script %}
{{ super() }}
{{ moment.include_moment() }}
{% endblock %}